<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: table_myrepeats.php 31512 2012-09-04 07:11:08Z monkey $
 */
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

class table_comment extends discuz_table
{
	public function __construct() {

		$this->_table = 'comment';
		$this->_pk    = '';

		parent::__construct();
	}


	//接受数据并写入
	public function add($data){
		    DB::insert($this->_table,$data);
		return mysql_insert_id();

	}

	//搜索比当前  ID大的值
	public function getByMaxId($channelId,$id){
		return DB::fetch_all("SELECT * from %t where channelId = %d AND id > %d", array($this->_table,$channelId,$id));
	}

	public function maxId($channelId){
		return DB::fetch_all("SELECT MAX(id) from %t where channelId = %d", array($this->_table,$channelId));
	}

}

?>